CentOS 6
Sponsored Link

Nginx - Install
2013/07/07
 
Install fast HTTP Server "Nginx" and configure HTTP Server with it.
[1] Install Nginx
[root@www ~]#
yum --enablerepo=epel -y install nginx
 
# install from EPEL
[2] Configure Nginx
[root@www ~]#
vi /etc/nginx/nginx.conf
# line 6: set it within number of CPU cores

worker_processes
2
;
# line 36: uncomment ( enable gzip )

gzip on;
# remove comment lines

[root@www ~]#
cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.org

[root@www ~]#
egrep -v "^ *#|^ *$" /etc/nginx/conf.d/default.conf.org > /etc/nginx/conf.d/default.conf

[root@www ~]#
vi /etc/nginx/conf.d/default.conf
# line 3: change to your server's name

server_name
www.srv.world
;
[root@www ~]#
/etc/rc.d/init.d/nginx start

Starting nginx: [ OK ]
[root@www ~]#
chkconfig nginx on

[3] Access to the default page of Nginx with Web browser and it's OK if the following page are shown.
 
Tweet